package com.weishi.project.training.domain;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.weishi.framework.aspectj.lang.annotation.Excel;
import io.swagger.annotations.ApiParam;
import lombok.Data;

import java.io.Serializable;
import java.util.*;


/**
 * 身体机能
 */
@Data
@TableName("tbl_sportsman_body_function")
public class SportsmanBodyFunction implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * PK
     */
    private Integer id;

    /**
     * 运动员Id
     */
    @ApiParam(name = "运动员Id")
    private Integer sportsmanId;

    @Excel(name = "运动员姓名")
    private String sportsmanName;

    @Excel(name = "采集时间")
    private String collectionTime;

    @Excel(name = "体重")
    private double weight;

    @Excel(name = "血红蛋白")
    private double hb;

    @Excel(name = "血尿素氨")
    private double bu;

    @Excel(name = "肌酸激酶")
    private double ck;

    /**
     * 尿酸
     */
    private double ua;

    /**
     * 晨脉
     */
    private double hr;

    @Excel(name = "血清睾酮")
    private double st;

    /**
     * 血乳酸
     */
    private double bla;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiParam(name = "开始时间")
    private Date startTime;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiParam(name = "结束时间/采集时间")
    private Date endTime;

    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date ctime;

    /**
     * 血清睾酮
     */
    private double tt;

    @Excel(name = "血压高压")
    private double hbp;

    @Excel(name = "血压低压")
    private double lbp;

    //@Excel(name = "晨脉")
    private double morningPulse;

    @Excel(name = "亚硝酸盐")
    private double nit;

    @Excel(name = "酸碱度")
    private double ph;

    @Excel(name = "葡萄糖")
    private double uglu;

    @Excel(name = "尿蛋白")
    private double rpro;

    @Excel(name = "潜血")
    private double bld;

    @Excel(name = "尿酮体")
    private double uket;

    @Excel(name = "尿胆红素")
    private double ubil;

    @Excel(name = "尿胆原")
    private double uro;

    @Excel(name = "尿白细胞")
    private double uleu;

    @Excel(name = "尿比重")
    private double sg;

    @Excel(name = "尿素")
    private double mol;

    @Excel(name = "皮质醇")
    private double gdl;

    @Excel(name = "皮质醇比值")
    private double tc;

    @Excel(name = "铁蛋白")
    private double ng;

    @Excel(name = "白细胞")
    private double wbc;

    //@Excel(name = "血红蛋白浓度")
    private double hcn;

    @Excel(name = "红细胞压积")
    private double htt;

    @Excel(name = "平均红细胞体积")
    private double mrbcv;

    @Excel(name = "血小板数")
    private double pct;

    @Excel(name = "每分通气量")
    private double vpm;

    @Excel(name = "最大摄氧量")
    private double maxOxygen;

    public static Object getMap(SportsmanBodyFunction vo) {
        List<Map<String, Object>> list = new ArrayList<>();
        Map<String, Object> weight = new HashMap<>();
        weight.put("name", "weight");
        weight.put("value", vo.getWeight());
        list.add(weight);
        Map<String, Object> hb = new HashMap<>();
        hb.put("name", "hb");
        hb.put("value", vo.getHb());
        list.add(hb);
        Map<String, Object> bu = new HashMap<>();
        bu.put("name", "bu");
        bu.put("value", vo.getBu());
        list.add(bu);
        Map<String, Object> ck = new HashMap<>();
        ck.put("name", "ck");
        ck.put("value", vo.getCk());
        list.add(ck);
        Map<String, Object> hbp = new HashMap<>();
        hbp.put("name", "hbp");
        hbp.put("value", vo.getHbp());
        list.add(hbp);
        Map<String, Object> lbp = new HashMap<>();
        lbp.put("name", "lbp");
        lbp.put("value", vo.getLbp());
        list.add(lbp);
        Map<String, Object> ua = new HashMap<>();
        ua.put("name", "ua");
        ua.put("value", vo.getUa());
        list.add(ua);
        Map<String, Object> hr = new HashMap<>();
        hr.put("name", "hr");
        hr.put("value", vo.getHr());
        list.add(hr);
        Map<String, Object> st = new HashMap<>();
        st.put("name", "st");
        st.put("value", vo.getSt());
        list.add(st);
        Map<String, Object> bla = new HashMap<>();
        bla.put("name", "bla");
        bla.put("value", vo.getBla());
        list.add(bla);
        Map<String, Object> tt = new HashMap<>();
        tt.put("name", "tt");
        tt.put("value", vo.getTt());
        list.add(tt);
        Map<String, Object> morningPulse = new HashMap<>();
        morningPulse.put("name", "morningPulse");
        morningPulse.put("value", vo.getMorningPulse());
        list.add(morningPulse);
        Map<String, Object> nit = new HashMap<>();
        nit.put("name", "nit");
        nit.put("value", vo.getNit());
        list.add(nit);
        Map<String, Object> ph = new HashMap<>();
        ph.put("name", "ph");
        ph.put("value", vo.getPh());
        list.add(ph);
        Map<String, Object> uglu = new HashMap<>();
        uglu.put("name", "uglu");
        uglu.put("value", vo.getUglu());
        list.add(uglu);
        Map<String, Object> rpro = new HashMap<>();
        rpro.put("name", "rpro");
        rpro.put("value", vo.getRpro());
        list.add(rpro);

        Map<String, Object> bld = new HashMap<>();
        bld.put("name", "bld");
        bld.put("value", vo.getBld());
        list.add(bld);
        Map<String, Object> uket = new HashMap<>();
        uket.put("name", "uket");
        uket.put("value", vo.getUket());
        list.add(uket);
        Map<String, Object> ubil = new HashMap<>();
        ubil.put("name", "ubil");
        ubil.put("value", vo.getUbil());
        list.add(ubil);
        Map<String, Object> uro = new HashMap<>();
        uro.put("name", "uro");
        uro.put("value", vo.getUro());
        list.add(uro);
        Map<String, Object> uleu = new HashMap<>();
        uleu.put("name", "uleu");
        uleu.put("value", vo.getUleu());
        list.add(uleu);
        Map<String, Object> sg = new HashMap<>();
        sg.put("name", "sg");
        sg.put("value", vo.getSg());
        list.add(sg);
        Map<String, Object> mol = new HashMap<>();
        mol.put("name", "mol");
        mol.put("value", vo.getMol());
        list.add(mol);

        Map<String, Object> gdl = new HashMap<>();
        gdl.put("name", "gdl");
        gdl.put("value", vo.getGdl());
        list.add(gdl);
        Map<String, Object> tc = new HashMap<>();
        tc.put("name", "tc");
        tc.put("value", vo.getTc());
        list.add(tc);
        Map<String, Object> ng = new HashMap<>();
        ng.put("name", "ng");
        ng.put("value", vo.getNg());
        list.add(ng);
        Map<String, Object> wbc = new HashMap<>();
        wbc.put("name", "wbc");
        wbc.put("value", vo.getWbc());
        list.add(wbc);
        Map<String, Object> hcn = new HashMap<>();
        hcn.put("name", "hcn");
        hcn.put("value", vo.getHcn());
        list.add(hcn);
        Map<String, Object> htt = new HashMap<>();
        htt.put("name", "htt");
        htt.put("value", vo.getHtt());
        list.add(htt);
        Map<String, Object> mrbcv = new HashMap<>();
        mrbcv.put("name", "mrbcv");
        mrbcv.put("value", vo.getMrbcv());
        list.add(mrbcv);
        Map<String, Object> pct = new HashMap<>();
        pct.put("name", "pct");
        pct.put("value", vo.getPct());
        list.add(pct);
        Map<String, Object> vpm = new HashMap<>();
        vpm.put("name", "vpm");
        vpm.put("value", vo.getVpm());
        list.add(vpm);
        Map<String, Object> maxOxygen = new HashMap<>();
        maxOxygen.put("name", "maxoxygen");
        maxOxygen.put("value", vo.getMaxOxygen());
        list.add(maxOxygen);

        return list;
    }

    public static Object getMapTo(SportsmanBodyFunction vo) {
        List<Map<String, Object>> list = new ArrayList<>();
        Map<String, Object> weight = new HashMap<>();
        Double max = 0.0001;
        Double min = -0.0001;
        if (!(vo.getWeight() < max) && (vo.getWeight() > min)) {
            weight.put("name", "weight");
            weight.put("value", vo.getWeight());
            list.add(weight);
        }
        Map<String, Object> hb = new HashMap<>();
        if (!(vo.getHb() < max) && (vo.getHb() > min)) {
            hb.put("name", "hb");
            hb.put("value", vo.getHb());
            list.add(hb);
        }
        Map<String, Object> bu = new HashMap<>();
        if (!(vo.getBu() < max) && (vo.getBu() > min)) {
            bu.put("name", "bu");
            bu.put("value", vo.getBu());
            list.add(bu);
        }
        Map<String, Object> ck = new HashMap<>();
        if (!(vo.getCk() < max) && (vo.getCk() > min)) {
            ck.put("name", "ck");
            ck.put("value", vo.getCk());
            list.add(ck);
        }
        Map<String, Object> hbp = new HashMap<>();
        if (!(vo.getHbp() < max) && (vo.getHbp() > min)) {
            hbp.put("name", "hbp");
            hbp.put("value", vo.getHbp());
            list.add(hbp);
        }
        Map<String, Object> lbp = new HashMap<>();
        if (!(vo.getLbp() < max) && (vo.getLbp() > min)) {
            lbp.put("name", "lbp");
            lbp.put("value", vo.getLbp());
            list.add(lbp);
        }
        Map<String, Object> ua = new HashMap<>();
        if (!(vo.getUa() < max) && (vo.getUa() > min)) {
            ua.put("name", "ua");
            ua.put("value", vo.getUa());
            list.add(ua);
        }

        Map<String, Object> hr = new HashMap<>();
        if (!(vo.getHr() < max) && (vo.getHr() > min)) {
            hr.put("name", "hr");
            hr.put("value", vo.getHr());
            list.add(hr);

        }

        Map<String, Object> st = new HashMap<>();
        if (!(vo.getSt() < max) && (vo.getSt() > min)) {
            st.put("name", "st");
            st.put("value", vo.getSt());
            list.add(st);

        }
        Map<String, Object> bla = new HashMap<>();
        if (!(vo.getBla() < max) && (vo.getBla() > min)) {
            bla.put("name", "bla");
            bla.put("value", vo.getBla());
            list.add(bla);
        }

        Map<String, Object> tt = new HashMap<>();
        if (!(vo.getTt() < max) && (vo.getTt() > min)) {
            tt.put("name", "tt");
            tt.put("value", vo.getTt());
            list.add(tt);
        }
        Map<String, Object> morningPulse = new HashMap<>();
        if (!(vo.getMorningPulse() < max) && (vo.getMorningPulse() > min)) {
            morningPulse.put("name", "morningPulse");
            morningPulse.put("value", vo.getMorningPulse());
            list.add(morningPulse);
        }
        Map<String, Object> nit = new HashMap<>();
        if (!(vo.getNit() < max) && (vo.getNit() > min)) {
            nit.put("name", "nit");
            nit.put("value", vo.getNit());
            list.add(nit);
        }
        Map<String, Object> ph = new HashMap<>();
        if (!(vo.getPh() < max) && (vo.getPh() > min)) {
            ph.put("name", "ph");
            ph.put("value", vo.getPh());
            list.add(ph);
        }
        Map<String, Object> uglu = new HashMap<>();
        if (!(vo.getUglu() < max) && (vo.getUglu() > min)) {
            uglu.put("name", "uglu");
            uglu.put("value", vo.getUglu());
            list.add(uglu);
        }
        Map<String, Object> rpro = new HashMap<>();
        if (!(vo.getRpro() < max) && (vo.getRpro() > min)) {
            rpro.put("name", "rpro");
            rpro.put("value", vo.getRpro());
            list.add(rpro);
        }

        Map<String, Object> bld = new HashMap<>();
        if (!(vo.getBld() < max) && (vo.getBld() > min)) {
            bld.put("name", "bld");
            bld.put("value", vo.getBld());
            list.add(bld);
        }
        Map<String, Object> uket = new HashMap<>();
        if (!(vo.getUket() < max) && (vo.getUket() > min)) {
            uket.put("name", "uket");
            uket.put("value", vo.getUket());
            list.add(uket);
        }
        Map<String, Object> ubil = new HashMap<>();
        if (!(vo.getUro() < max) && (vo.getUro() > min)) {
            ubil.put("name", "ubil");
            ubil.put("value", vo.getUro());
            list.add(ubil);
        }
        Map<String, Object> uro = new HashMap<>();
        if (!(vo.getUro() < max) && (vo.getUro() > min)) {
            uro.put("name", "uro");
            uro.put("value", vo.getUro());
            list.add(uro);
        }
        Map<String, Object> uleu = new HashMap<>();
        if (!(vo.getUleu() < max) && (vo.getUleu() > min)) {
            uleu.put("name", "uleu");
            uleu.put("value", vo.getUleu());
            list.add(uleu);
        }
        Map<String, Object> sg = new HashMap<>();
        if (!(vo.getSg() < max) && (vo.getSg() > min)) {
            sg.put("name", "sg");
            sg.put("value", vo.getSg());
            list.add(sg);
        }
        Map<String, Object> mol = new HashMap<>();
        if (!(vo.getMol() < max) && (vo.getMol() > min)) {
            mol.put("name", "mol");
            mol.put("value", vo.getMol());
            list.add(mol);
        }

        Map<String, Object> gdl = new HashMap<>();
        if (!(vo.getGdl() < max) && (vo.getGdl() > min)) {
            gdl.put("name", "gdl");
            gdl.put("value", vo.getGdl());
            list.add(gdl);
        }
        Map<String, Object> tc = new HashMap<>();
        if (!(vo.getTc() < max) && (vo.getTc() > min)) {
            tc.put("name", "tc");
            tc.put("value", vo.getTc());
            list.add(tc);
        }
        Map<String, Object> ng = new HashMap<>();
        if (!(vo.getNg() < max) && (vo.getNg() > min)) {
            ng.put("name", "ng");
            ng.put("value", vo.getNg());
            list.add(ng);
        }
        Map<String, Object> wbc = new HashMap<>();
        if (!(vo.getWbc() < max) && (vo.getWbc() > min)) {
            wbc.put("name", "wbc");
            wbc.put("value", vo.getWbc());
            list.add(wbc);
        }
        Map<String, Object> hcn = new HashMap<>();
        if (!(vo.getHcn() < max) && (vo.getHcn() > min)) {
            hcn.put("name", "hcn");
            hcn.put("value", vo.getHcn());
            list.add(hcn);
        }
        Map<String, Object> htt = new HashMap<>();
        if (!(vo.getHtt() < max) && (vo.getHtt() > min)) {
            htt.put("name", "htt");
            htt.put("value", vo.getHtt());
            list.add(htt);
        }
        Map<String, Object> mrbcv = new HashMap<>();
        if (!(vo.getMrbcv() < max) && (vo.getMrbcv() > min)) {
            mrbcv.put("name", "mrbcv");
            mrbcv.put("value", vo.getMrbcv());
            list.add(mrbcv);
        }
        Map<String, Object> pct = new HashMap<>();
        if (!(vo.getPct() < max) && (vo.getPct() > min)) {
            pct.put("name", "pct");
            pct.put("value", vo.getPct());
            list.add(pct);
        }
        Map<String, Object> vpm = new HashMap<>();
        if (!(vo.getVpm() < max) && (vo.getVpm() > min)) {
            vpm.put("name", "vpm");
            vpm.put("value", vo.getVpm());
            list.add(vpm);
        }
        Map<String, Object> maxOxygen = new HashMap<>();
        if (!(vo.getMaxOxygen() < max) && (vo.getMaxOxygen() > min)) {
            maxOxygen.put("name", "maxoxygen");
            maxOxygen.put("value", vo.getMaxOxygen());
            list.add(maxOxygen);
        }
        return list;
    }
}